#include "plcreadthread.h"
#include "plcconnecter.h"
#include <log/log.h>
#include "modbus/PLCException.h"
#include "plcdataprocess.h"
#include <QDebug>

namespace HIM {

void PlcReadThread::run()
{   
    //HIM_INFO(tr("PLC polling thread run").toStdString());
    QTimer timer;
    connect(&timer,&QTimer::timeout,this,&PlcReadThread::on_timeout,Qt::DirectConnection);
    timer.start(1000);
    exec();
    //HIM_INFO(tr("PLC polling thread quit").toStdString());
    return;
}

void PlcReadThread::on_timeout()
{
    PLCDATAPROCESSER.setPlcData();
}

}
